IP-SLA DNS Tracking
Original Post # http://jcape.name/2011/04/23/anycast-ip-sla-howto/
- Configuration to be performed on a server
- Configuration to be performed on the router in site A
- Configuration to be performed on the router in site B
The next step is to configure the routers to route packets destined for the anycast address via the primary network interface on the servers, run test queries against named
on the primary network interface of that server, and remove the route to the anycast address if those queries take longer than 2 seconds to return:
Router1(config)#ip sla 500
Router1(config-ip-sla)#dns example.org name-server 10.20.20.20
Router1(config-ip-sla-dns)#frequency 9
Router1(config-ip-sla-dns)#timeout 2000
Router1(config-ip-sla-dns)#exit
Router1(config)#ip sla schedule 500 life forever start-time now
Router1(config)#track 500 ip sla 500
Router1(config)#ip route 10.10.10.10 255.255.255.255 10.20.20.20 name dns.example.org track 500
Router1(config)#ip access list standard static-to-ospf-list
Router1(config-ip-access)#permit 10.10.10.10
Router1(config-ip-access)#exit
Router1(config)#route-map static-to-ospf-map 10
Router1(config-route-map)#match ip address static-to-ospf-list
Router1(config-route-map)#exit
Router1(config)#router ospf 1
Router1(config-router)#redistribute static metric-type 1 subnets route-map static-to-ospf-map
Router1(config-router)#exit
Router1(config)#
Router2(config)#ip sla 500
Router2(config-ip-sla)#dns example.org name-server 10.30.30.30
Router2(config-ip-sla-dns)#frequency 9
Router2(config-ip-sla-dns)#timeout 2000
Router2(config-ip-sla-dns)#exit
Router2(config)#ip sla schedule 500 life forever start-time now
Router2(config)#track 500 ip sla 500
Router2(config)#ip route 10.10.10.10 255.255.255.255 10.30.30.30 name dns.example.org track 500
Router2(config)#ip access list standard static-to-ospf-list
Router2(config-ip-access)#permit 10.10.10.10
Router2(config-ip-access)#exit
Router2(config)#route-map static-to-ospf-map 10
Router2(config-route-map)#match ip address static-to-ospf-list
Router2(config-route-map)#exit
Router2(config)#router ospf 1
Router2(config-router)#redistribute static metric-type 1 subnets route-map static-to-ospf-map
Router2(config-router)#exit
Router2(config)#